import request from '@/utils/request'

export function getOrderList(data:any){
  return request({
    url: '/sale/order/orderListByPage',
    method: 'post',
    data
  })
}

export function insertOrder(data:any){
  return request({
    url: '/sale/order/insertOrder',
    method: 'post',
    data
  })
}

export function deleteOrder(params:any){
  return request({
    url: '/sale/order/deleteOrder',
    method: 'delete',
    params: params,
  })
}
  
export function updateOrder(data:any){
  return request({
    url: '/sale/order/updateOrder',
    method: 'put',
    data
  })
}

export function exportOrders(data:any){
  return request({
    url: '/sale/order/exportOrders',
    method: 'post',
    data,
    responseType: 'blob',
  })
}

export function getOrderSuggestions(params:any){
  return request({
    url: "/sale/order/getSuggestion",
    method: 'get',
    params
  })
}

export function getUsualSkuInfo(){
  return request({
    url: "/sale/order/getUsualSkuInfo",
    method: 'get'
  })
}

export function getOrEstimationWeight(params:any){
  return request({
    url: "/sale/order/getOrEstimationWeight",
    method: 'get',
    params
  })
}

export function cancelOrder(params:any){
  return request({
    url: "/sale/order/cancelOrder",
    method: 'post',
    params
  })
}